//
//  MTCardListCollectionViewCell.m
//  met
//
//  Created by 李晓杰 on 2019/5/13.
//  Copyright © 2019 李晓俊. All rights reserved.
//

#import "MTCardListCollectionViewCell.h"

@implementation MTCardListCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.bgView];
        [self addSubview:self.nameBut];

        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.bottom.right.mas_equalTo(self);
        }];

        [self.nameBut mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.mas_equalTo(self);
            make.left.mas_equalTo(self).with.offset(2);
            make.right.mas_equalTo(self).with.offset(-2);
        }];
    }
    return self;
}
- (UIImageView *)bgView{
    if (_bgView == nil) {
        _bgView = [[UIImageView alloc] init];
    }
    return _bgView;
}


- (HighLightButton *)nameBut{
    if (_nameBut == nil) {
        _nameBut = [HighLightButton new];
        _nameBut.titleLabel.font =  CLRudeCircleTextFont(18);
        _nameBut.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        [_nameBut setTitleColor:KBlackColor forState:UIControlStateNormal];
        _nameBut.userInteractionEnabled = NO;
        _nameBut.lineBreakMode = NSLineBreakByTruncatingTail;
    }
    return _nameBut;
}
@end
